import request from '@/utils/request'
// 查询最新课程接口:
export function mostNew(data) {
	return request({
		url: '/api/course/mostNew',
		method: 'post',
		data
	})
}

// 课程详情
export function getDetail(params) {
	return request({
		url: '/api/course/getDetail',
		params
	})
}

// 检查是否有权限
export function coueseCheckAuth(params) {
	return request({
		url: '/api/course/checkAuth',
		params
	})
}

// 下载接口
export function downloadAttachment(params) {
	return request({
		url: '/api/course/downloadAttachment',
		params,
		responseType: 'blob'
	})
}

// 课程播放接口
export function player(params) {
	return request({
		url: '/api/player/play',
		params,
	})
}

// 记录播放历史
export function recordHistory(data) {
	return request({
		url: '/api/course/history/recordHistory',
		method: 'post',
		data,
	})
}

// 最后一次播放接口
export function getLastHistoryByChapterId(params) {
	return request({
		url: '/api/course/history/getLastHistoryByChapterId',
		params,
	})
}